home *** CD-ROM | disk | FTP | other *** search
/ Die Ultimative Software-P…i Collection 1996 & 1997 / Die Ultimative Software-Pakete CD-ROM fur Atari Collection 1996 & 1997.iso / p / portfoli / small_c / copy.sci < prev    next >
Encoding:
Text File  |  1996-10-30  |  352 b   |  20 lines

  1. copy(f,t)
  2. char *f, *t;
  3. {
  4.    int infd, outfd;
  5.    char buf[128],len;
  6.    
  7.    if ( (infd=fopen(f,"r")) < 0 )
  8.       return err(f);
  9.    if ( (outfd=fopen(t,"w")) < 0 )
  10.       return err(t);
  11.    while( (len=fread(buf,128,infd))>0 )
  12.       fwrite(buf,len,outfd);
  13.    fclose(outfd);
  14.    fclose(infd);
  15. }
  16. err(f)
  17. {
  18.    printf("can't open <%s>\n",f);
  19. }
  20.